package com.sinocare.report.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.sinocare.common.entity.vo.Across;
import com.sinocare.common.entity.vo.Yield;
import com.sinocare.common.result.Result;
import com.sinocare.common.result.ResultCode;
import com.sinocare.report.service.YieldService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;


@CrossOrigin
@RestController
@RequestMapping("/Yield")
@Api(tags = "报表管理接口")
public class YieldController {
    @Resource
    private YieldService yieldService;
    @ApiOperation(value = "合格率", notes = "合格率", httpMethod = "GET")
    @RequestMapping(value = "yield", method = RequestMethod.GET)
    public Result findYield(String store_code) throws Exception {
        List<Yield> h1=yieldService.query(store_code);

        for (Yield yield : h1) {
            System.out.println(yield);
        }

        return  Result.ok(ResultCode.SUCCESS,h1);
    }



    }
